//
//  HMLikeModel.m
//  HeartMark
//
//  Created by rimi on 16/11/10.
//  Copyright © 2016年 黄华强. All rights reserved.
//

#import "HMLikeModel.h"
#import <AVOSCloud/AVOSCloud.h>
@implementation HMLikeModel

- (instancetype)initWithLikeModelDict:(NSDictionary *)dict{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dict];
        [self setupCellHeight:dict[@"content"]];
    }
    return self;
}

- (void)setupCellHeight:(NSString *)content {
    CGSize maxSize = CGSizeMake(SCREEN_WIDTH/2 - 30, CGFLOAT_MAX);
    CGRect contentRect = [content boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil];
    
        _cellHeight = contentRect.size.height + 65;
    if (_cellHeight > 222) {
        _cellHeight = 222;
    }
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

@end
